package model.information;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Observable;

/**
 * A class that represents a memo.
 * @author Tobias Møller Kjærsgaard
 * @author Hjalte Blichfeldt Flyger
 * @author Gitte Simonsen
 * @author Claus Lund
 */
public class Memo extends Observable implements Serializable {
    private Calendar date;
    private String note;

    public Memo(String note) {
        this.note = note;
        this.date = Calendar.getInstance();
    }

    public Calendar getDate() {
        return date;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
        this.setChanged();
        this.notifyObservers("memo");
    }

    @Override
    public String toString() {
        return date.get(Calendar.DATE) + "-" + (int)(date.get(Calendar.MONTH) + 1) + "-" +date.get(Calendar.YEAR);
    }

}